// usercenter.js
var app=getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo:{},
    memberInfo:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //console.log(app.globalData)
    var that = this
    var ID=wx.getStorageSync('userID');
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })

    that.setData({
      memberInfo:ID
    })

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  openRecords: function () {
    wx.navigateTo({
      url: '../allrecords/allrecords',
    })
  },
  openPreserve:function(){
    wx.navigateTo({
      url: '../mypreserve/mypreserve',
    })
  },
  openRent: function () {
    wx.navigateTo({
      url: '../myrent/myrent',
    })
  }, 
  openInform: function () {
    wx.navigateTo({
      url: '../rentinform/rentinform',
    })
  },
  signout: function () {
    wx.clearStorageSync();
    wx.navigateTo({
      url: '../signup/signup',
      success:function(){
      }
    })
  }

})